package com.joker.airoleplayplatformback.domain.enums;


import lombok.Getter;

/**
 * @description: 知识库的状态枚举值
 * @author: feixiang.li
 * @date: 2025-09-27 20:14
 */
@Getter
public enum KnowledgeBaseEnum {

    UNKNOWN(0, "未知"),
    PENDING(1, "上传OSS成功"),
    SUCCESS(2, "上传知识库成功"),
    ERROR(3, "上传知识库失败"),

    DELETED(4, "删除成功"),

    ;
    private final int code;
    private final String message;
    KnowledgeBaseEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }


    public static String getMessageByCode(int code) {
        for (KnowledgeBaseEnum value : KnowledgeBaseEnum.values()) {
            if (value.code == code) {
                return value.message;
            }
        }
        return null;
    }

}
